<template>
  <a-modal
    v-model:visible="props.wgwjwfVisible"
    title="请选择处理方式"
    :width="400"
    @cancel="emits('update:wgwjwfVisible', false)"
    @ok="handleSignAbnormal"
  >
    <div class="px-3 pt-3">
      <a-form ref="setForm" :model="form">
        <a-form-item
          label="处理方式"
          :rules="{
            required: true,
            message: '请选择处理方式',
            trigger: 'change',
          }"
          name="czfa"
        >
          <a-radio-group size="small" v-model:value="form.czfa" button-style="solid">
            <div>
              <a-radio value="WGWJWF_STLF"> 试题0分处理 </a-radio>
            </div>
            <div>
              <a-radio value="WGWJWF_KMLF"> 科目0分处理 </a-radio>
            </div>
          </a-radio-group>
        </a-form-item>
        <a-form-item
          label="备注"
          name="remark"
          :rules="{
            required: true,
            message: '请输入备注',
            trigger: 'change',
          }"
        >
          <a-textarea v-model:value="form.remark" placeholder="请输入备注" />
        </a-form-item>
      </a-form>
    </div>
  </a-modal>
</template>

<script setup last="ts">
import { reactive, watch, ref, nextTick } from 'vue'
const Data = reactive({
  pointPyAccount: null,
})

const setForm = ref(null)
function handleSignAbnormal() {
  setForm.value.validate().then(() => {
    emits('success', {
      ...form.value,
    })
    emits('update:wgwjwfVisible', false)
    nextTick(() => {
      setForm.value.resetFields()
    })
  })
}
const props = defineProps({
  wgwjwfVisible: {
    type: Boolean,
    default: false,
  },
})
const emits = defineEmits(['update:wgwjwfVisible', 'success'])

const form = ref({})
</script>
